define(['jquery'], () => {
    const baseUrl = 'http://www.xmyxapp.com/api'
    return {
        getTabs() {
            return new Promise(resolve => {
                $.get(`${baseUrl}/tabs`, resolve)
            })
        },
        getCategory(id, start, sort) {
            return new Promise(resolve => {
                $.get(`${baseUrl}/tab/${id}?start=${start}&sort=${sort}`, resolve)
            })
        },
        getDetail(id) {
            return new Promise(resolve => {
                $.get(`${baseUrl}/detail`, { id }, resolve)
            })
        }
    }
})